# -*- coding: UTF-8 -*-     
#快速排序算法
#@param nums, a list of integers
def quick_sort(nums,left,right):
    if(right - left <= 0 ):
        return
    l,r = left,right
    pivot = nums[left]
    while (l < r):
        while (l < r and pivot <= nums[r]):
            r -= 1
        if( l < r):
            nums[l] = nums[r]
            l += 1
        while (l < r and pivot >= nums[l]):
            l += 1
        if( l < r ):
            nums[r] = nums[l]
            r -= 1
    nums[l] = pivot
    quick_sort(nums,left,l-1)
    quick_sort(nums,l+1,right)
def merge_sort(nums):
    pass
def merge(a,b) :
    ls = [];
    i,j = 0,0;
    while i < len(a) and j < len(b):
        if a[i] < b[j]:
            ls.append(a[i])
            i += 1
        else :
            ls.append(b[j])
            j += 1
    if i < len(a):
        ls.append(a[i:len(a)])
    if j < len(b):
        ls.append(b[j:len(b)])
    return ls     

